﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DDD4Fun.Specification
{
    public class NotSpecification<T>:CompositeSpecification<T>
    {
        private ISpecification<T> m_wrapped;

        public NotSpecification(ISpecification<T> x)
        {
            m_wrapped = x;
        }

        public override bool IsSatisfiedBy(T candidate)
        {
            return !m_wrapped.IsSatisfiedBy(candidate);
        }
    }
}
